{template 'webheader'}
{template 'common/header'}
<div class="panel panel-info">
    <div class="panel-heading">筛选</div>
    <div class="panel-body">
        <form action="./index.php?dd=1" method="get" class="form-horizontal" role="form">
            <div class="form-group">
                <input type="hidden" name="c" value="site">
                <input type="hidden" name="a" value="entry">
                <input type="hidden" name="do" value="list">
                <input type="hidden" name="op" value="index">
                <input type="hidden" name="m" value="hai105_daka">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">时间</label>
                <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                    {php echo _tpl_form_field_date('date', $value = $_GPC['date'], $withtime = false);}
                </div>
            </div>
<!--            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">时间</label>
                <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                    <input value="{php echo $_GPC['uid'];}" type="text" name="uid" class="form-control" placeholder="用户UID">
                </div>
            </div>-->
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
                <div class="col-xs-12 col-sm-3 col-md-2 col-lg-2">
                    <button type='submit' class="btn btn-primary">提交</button>
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">发放链接</label>
                <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                    <span class="form-control"><a href='{$cronurl}' target="_blank">点击发放奖励</a></span>
                    <span>
                        若奖励未发放，可手工执行该链接进行发放<br>
                        若执行后未发放，请前往:参数设置->打开调试模式后，再次执行
                    </span>
                </div>
            </div>
        </form>
    </div>
</div>
<div class="panel panel-default">
    <div class="panel-body table-responsive">
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>#</th>
                    <th>头像</th>
                    <th>昵称</th>
                    <th>UID</th>
                    <th>OPENID</th>
                    <th>参与时间</th>
                    <th>参与金额</th>
                    <th>是否打卡</th>
                    <th>打卡时间</th>
                    <th>奖励金</th>
                </tr>
            </thead>
            <tbody>
                {loop $list $item}
                <tr>
                    <th scope="row">{$item['id']}</th>
                    <td><img src="{$item['fansinfo']['headimgurl']}" width="60" height="60"/></td>
                    <td>{$item['fansinfo']['nickname']}</td>
                    <td>{$item['uid']}</td>
                    <td>{$item['fansinfo']['openid']}</td>
                    <td>{$item['create_time']}</td>
                    <td>{$item['pay_money']}</td>
                    <td>
                        {php echo $item['checked']?'已打卡':'未打卡';}
                        <!-- {if !$item['checked']}
                        <button onclick="buqian({$item['id']})" class="btn btn-primary">补签</button>
                        {/if} -->
                        
                    </td>
                    <td>{$item['checked_time']}</td>
                    <td>{$item['money']}</td>
                </tr>
                {/loop}
            </tbody>
        </table>
    </div>
    <div class="pull-right">{$pager}</div>
</div>
<script>
    function buqian (id) {
        var cfm = weui.confirm('确认补签',function(){
            $.ajax({
                url:window.location.href+'&op=buqian',
                data:{
                    id:id
                }
            }).then(function(res){
                res = JSON.parse(res);
                cfm.hide(function(){
                    weui.alert(res.message,function() {
                        location.reload();
                    });
                })
            })
            return false;
        })
    }
</script>
{template 'common/footer'}